/*
 * field.h
 *
 *  Created on: 11/12/2008
 *      Author: desadoc
 */

#ifndef FIELD_H_
#define FIELD_H_

#include <QString>
using namespace std;

class field {

	public:

	enum FLD_TYPE {
				NONE,
				STRING,
				INTEGER,
				FLOAT,
			};

	private:

		QString s;
		int i;
		float f;
		bool b;

		FLD_TYPE tp;

		void strToData(string& s);

	public:

		field(string& s){strToData(s);}

		void get_data(QString& str, int* in, float* fl, bool* bo){
			str = s;
			(*in) = i;
			(*fl) = f;
			(*bo) = b;
		}

		void set_data(QString& str, int in, float fl, bool bo){
					s = str;
					i = in;
					f = fl;
					b = bo;
		}

		FLD_TYPE type(FLD_TYPE t){
			if(t == NONE) return tp;

			tp = t;
			return tp;
		}
};


#endif /* FIELD_H_ */
